package com.trkj.controllers;


import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.trkj.pojos.HospWorkInNotice;
import com.trkj.service.HospWorkInNoticeService;
import com.trkj.service.OutErxService;
import com.trkj.vo.OutErxVo;

@Controller
public class HospWorkController {
	@Autowired
	private OutErxService outErxService;
	@Autowired
	private HospWorkInNoticeService hwinService;
	
	@RequestMapping("/to_hosp_work_patient_erx")
	public String to_hosp_work_patient_erx(){
		return "hosp_work_patient_erx";
	}
	//模糊查询挂号门诊病人  By likeName
	@RequestMapping("/queryPatientByLikeNameForOutErx")
	@ResponseBody
	public Map<String,Object> queryOutMenByLikeNameOutErx(String likeName,int page,int rows){
		return  outErxService.queryOutManByLikeName(likeName, page, rows);
	}
	
	
	//模糊查询挂号门诊病人   By  挂号id
	@RequestMapping("/queryPatientByLikeIDForOutErx")
	@ResponseBody
	public Map<String,Object> queryOutManByOutId(String likeID,int page,int rows){
		return outErxService.queryOutManByLikeID(likeID, page, rows);
	}
	
	//跳转门诊查询界面
	@RequestMapping("/to_queryOutManInfo")
	public String to_queryOutManInfo(){
		return "query_out_man_info";
	}
	
	//跳转到排班页面
	@RequestMapping("/to_hosp_work_arrange_schedual")
	public String to_hosp_work_arrange_schedual(){
		return "arrange_schedual";
	}
	//开门诊电子处方
	@RequestMapping("/add_out_erx")
	public void addOutErx(OutErxVo outErxVo){
		outErxService.addOutErx(outErxVo);
	}
	
	//跳到住院通知界面
	@RequestMapping("/to_hosp_in_notice")
	public String to_hosp_in_notice(){
		return "hosp_work_in_notice";
	}
	
	//开住院通知
	@RequestMapping("/add_in_notice")
	public void add_in_notice(HospWorkInNotice hospWorkInNotice){
		System.err.println(hospWorkInNotice);
		hwinService.saveInNotice(hospWorkInNotice);
	}
	
	//查询所有住院通知
	@RequestMapping("/load_notice_record")
	@ResponseBody
	public Map<String,Object> inRecordNotice(int page,int rows){
		return hwinService.loadInNoticeRecord(page, rows);
	}
}